﻿// -----------------------------------------------------------------------
// <copyright file="MapInfo.cs" company="DarkBone">
// DarkBone
// </copyright>
// -----------------------------------------------------------------------

namespace DarkBone.Engine.Collections
{
   /// <summary>
   /// Map information
   /// </summary>
   public struct MapInfo
   {
      /// <summary>
      /// Top bound
      /// </summary>
      public int Top;

      /// <summary>
      /// Bottom bound
      /// </summary>
      public int Bottom;

      /// <summary>
      /// Right bound
      /// </summary>
      public int Right;

      /// <summary>
      /// Left Bound
      /// </summary>
      public int Left;

      /// <summary>
      /// Maximum width
      /// </summary>
      public int Width;

      /// <summary>
      /// Maximum height
      /// </summary>
      public int Height;

      /// <summary>
      /// Map template
      /// </summary>
      public MapTemplate Template;
   }
}

/*
         var bz = new byte[neutralUnits.Count * 8];
         for (var i = 0; i < neutralUnits.Count; i++)
         {
            if (((neutralUnits[i].Template.FrindlyName != "Mineral Field")
                 && (neutralUnits[i].Template.FrindlyName != "Rich Mineral Field"))
                && (neutralUnits[i].Template.FrindlyName != "Vespene Geyser"))
            {
               continue;
            }

            Array.Copy(BitConverter.GetBytes(neutralUnits[i].UnitStruct.X), 0, bz, (i * 8) + 0, 4);
            Array.Copy(BitConverter.GetBytes(neutralUnits[i].UnitStruct.Y), 0, bz, (i * 8) + 4, 4);
         }

         SHA1 sha = new SHA1CryptoServiceProvider();
         this.mapInfo.Template = MapTemplates.GetTemplate(sha.ComputeHash(bz).Aggregate(string.Empty, (current, b) => current + b.ToString("X2")));
         Debug.WriteLine("MapInfo: " + this.mapInfo.Template.HashCode + " => " + this.mapInfo.Template.Filename);
 */